<?php
/**
 * @package WordPress
 * @subpackage Bside
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<?php 
/* define some variales */        
        $feed = get_bloginfo('rss2_url'); 
?>

<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

<title><?php wp_title('|', true, 'right'); ?> <?php bloginfo('name'); ?></title>

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="shortcut icon" href="<?php bloginfo('template_url'); ?>/images/favicon.ico" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<!-- seo for description and keywords {{{-->
<?php if (is_home()){
    $description = "8码卦是萧渔的个人网站，主要关注于社会时事、网络技术发展、国学、西方文化等";
    $keywords = "WordPress,互联网,国学,历史";
} elseif (is_single()){
    if ($post->post_excerpt) {
        $description     = $post->post_excerpt;
    } else {
        $description = substr(strip_tags($post->post_content),0,220);
    }
    $keywords = "";       
    $tags = wp_get_post_tags($post->ID);
    foreach ($tags as $tag ) {
        $keywords = $keywords . $tag->name . ", ";
    }
}
?>
<!-- end of seo }}}-->
<meta name="keywords" content="<?php echo $keywords ?>" />
<meta name="description" content="<?php echo $description ?>" />
<?php if(is_page('thread-twitter')) : ?>
    <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/thread-twitter.css" type="text/css" media="screen" />
<?php endif; ?>
<?php if(is_page('nbsb')) : ?>
    <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/nbsb.css" type="text/css" media="screen" />
<?php endif; ?>
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<!-- start javascript -->
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/ddmenu.js"></script><!-- load menu.js for nice rss subscription menu -->

<?php wp_head(); ?>
</head>
<body>
<div id="page">

<!-- begin of header {{{-->
<div id="header">
    <div id="menubar">
    <ul id="menu" class="menu">
        <li class="<?php if(is_home()) echo 'current_page_item'; ?>"><a href="<?php bloginfo('url'); ?>">首页</a></li>
        <?php wp_list_pages('sort_column=menu_order&title_li='); ?>
        <!-- rss sub menu {{{-->
        <li class="rss_feed">
                <a class="feedrss" title="欢迎订阅8码卦" href="<?php bloginfo('rss2_url'); ?>">@RSS订阅</a>
                <ul>
                <li id="google_reader"><a class="reader" title="Subscribe with Google" href="http://fusion.google.com/add?feedurl=<?php echo $feed; ?>"><span>Google</span></a></li>
					<li id="youdao_reader"><a class="reader" title="Subscribe with Youdao" href="http://reader.youdao.com/#url=<?php echo $feed; ?>"><span>有道</span></a></li>
					<li id="xianguo_reader"><a class="reader" title="Subscribe with Xian Guo" href="http://www.xianguo.com/subscribe.php?url=<?php echo $feed; ?>"><span>鲜果</span></a></li>
					<li id="zhuaxia_reader"><a class="reader" title="Subscribe with Zhua Xia" href="http://www.zhuaxia.com/add_channel.php?url=<?php echo $feed; ?>"><span>抓虾</span></a></li>
					<li id="yahoo_reader"><a class="reader" title="Subscribe with My Yahoo!"	href="http://add.my.yahoo.com/rss?url=<?php echo $feed; ?>"><span>My Yahoo!</span></a></li>
					<li id="newsgator_reader"><a class="reader" title="Subscribe with newsgator"	href="http://www.newsgator.com/ngs/subscriber/subfext.aspx?url=<?php echo $feed; ?>"><span>newsgator</span></a></li>
					<li id="bloglines_reader"><a class="reader" title="Subscribe with Bloglines"	href="http://www.bloglines.com/sub/<?php echo $feed; ?>"><span>Bloglines</span></a></li>
					<li id="inezha_reader"><a class="reader" title="Subscribe with iNezha"	href="http://inezha.com/add?url=<?php echo $feed; ?>"><span>哪吒</span></a></li>
                </ul>
        </li>
        <!-- end of rss menu }}}-->
    </ul>
    </div><!-- navigation menu list in header -->
	<div id="headerimg" class="hidden">
		<div class="description"><?php bloginfo('description'); ?></div>
	</div>
</div>
<!-- end of header }}}-->
<hr />
<?php if(!is_page('nbsb')) : ?>
<?php include (TEMPLATEPATH . '/includes/header-box.php'); ?>
<?php endif; ?>
